package rmi;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * @author REMY Timothée and CARTIER Arthur
 * 
 */
public interface UserInterface extends Remote {
	
	public abstract void disconnect(String pseudo) throws RemoteException;

	/**
	 * Getter of the property <tt>ip</tt>
	 * 
	 * @return Returns the ip.
	 * @uml.property name="ip"
	 */
	public abstract String getIp() throws RemoteException;

	/**
	 * Getter of the property <tt>port</tt>
	 * 
	 * @return Returns the port.
	 * @uml.property name="port"
	 */
	public abstract int getPort() throws RemoteException;

	/**
	 * Getter of the property <tt>pseudo</tt>
	 * 
	 * @return Returns the pseudo.
	 * @uml.property name="pseudo"
	 */
	public abstract String getPseudo() throws RemoteException;

	/**
	 * This method handle invitations in a discussion
	 * 
	 * @param newDiscussion
	 *            the remote discussion object of the friend who invited us on
	 *            this discussion
	 * @return true if the discussion is picked-up currently it's always
	 *         picked-up
	 */
	public abstract boolean initDiscussion(DiscussionInterface newDiscussion)
			throws RemoteException;

	/**
	 * Recursively search a user with the pseudo given in argument by asking our
	 * currently connected "friends" up to the "ttl" depth
	 * 
	 * @param pseudo
	 *            the pseudo of the searched user
	 * @param ttl
	 *            maximal depth of the recursive search
	 * @return the user object of the searched user if founded otherwise null
	 *         value
	 * @throws RemoteException
	 */
	public abstract UserInterface searchFriend(String pseudo, int ttl)
			throws RemoteException;

}